from flask import jsonify


def setFutrueObjToJson(records):
    result = [
        {
            "variety": record.variety,
            "time": record.time,
            "price": record.price,
            "volume": record.volume,
            "bsFlag": record.bsFlag,
            "formatTime": record.formatTime
        }
        for record in records
    ]

    return jsonify(result)